<template>
  <block>
    <u-sticky v-if="tabList.length>0" bgColor="#fff">
      <u-tabs :list="tabList" @click="switchTab" lineWidth="30" lineHeight="7" :lineColor="`url(`+lineBg+`) 100% 100%`" :activeStyle="{
        color: '#303133',
        fontWeight: 'bold',
        transform: 'scale(1.05)'
    }" :inactiveStyle="{
        color: '#606266',
        transform: 'scale(1)'
    }" itemStyle="height: 44px;width: 28%;"></u-tabs>
    </u-sticky>

    <slot>
    </slot>
    <!-- 无商品显示 -->
    <view v-if="tableData.length===0" class="empty">
      <view class="img">
        <image src="https://mm.wentsoft.com/images/empty-img/coupon-empty.png" />
      </view>
      <view class="text">没有找到对应卡券，看看别的吧</view>
    </view>

    <u-loadmore v-if="tableData.length>0" :status="loadMoreStatus" color="#999" marginTop="40" height="20" lineColor="#999" dashed />
  </block>
</template>
<script>
/**
 * example  
 * <tableData :tabList="tabList">
 *  <template v-slot:todo="{ todoitem }">
 *  {{ todoitem.text }}
 *  </template>
 * </tableData>
 */
export default {
  props: {
    tabList: {
      type: Array,
      default: () => []
    },
    searchTableQuery: {
      type: Object,
      default: {
        size: 10,
        current: 1
      }
    },
  },
  data() {
    return {
      currentTab: 1, // 选中的分类项(默认为第一个分类)
      searchTableData: {
        records: [],
        total: 0, // 总数
        pages: 0 // 总页数
      },
      tableData: [],//表单数据
      loadMoreStatus: 'loadmore',
      lineBg: ""
    }
  },
  computed: {
    userInfo() {
      return this.$store.getters.userInfo
    }
  },
  methods: {}
}
</script>

<style lang="scss" scoped>
</style>
